﻿using Kanban.IDal;
using Kanban.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Kanban.Dal
{
    public class InterfaceDefaultDal : BaseDal<InterfaceDefault>, IInterfaceDefaultDal
    {
        public InterfaceDefaultDal()
        {
            TableName = "InterfaceDefault";
        }

        public Task<Tuple<IList<object>, int>> GetSysConfigPageData(string search, int pageSize, int pageIndex)
        {
            string whereSql = "1 = 1";
            if (!string.IsNullOrEmpty(search))
            {
                whereSql += $" AND (InterfaceName LIKE '%{search}%' OR PropertyName LIKE '%{search}%')";
            }
            return GetPageAsync("InterfaceDefault with(NOLOCK)", "*", whereSql, "Id", pageSize, pageIndex);
        }
    }
}
